package controller;

import com.mysql.jdbc.StringUtils;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import service.UpdateUsersService;

@Controller
@RequestMapping("/UpdateUsers")
public class UpdateUsersController {

    private UpdateUsersService usersService;

    public UpdateUsersService getUsersService() {
        return usersService;
    }
    @RequestMapping(value = "/updatewd.do",method = RequestMethod.GET)
    public String updatepwd(String id,String username, String password, Model model){
        boolean flag = false;
            flag = usersService.upaatepassword(Integer.parseInt(id), username, password);
            if(flag){
                System.out.println("修改成功");
                return "userList";
            }else{
                return "updateUser";
            }

        }
}
